﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Communication
{
    public class PumpControl:ControlBase
    {
        string mOP = "OP";//开泵
        string mCl = "CL";//关泵
        string mNP1 = "NP1";//设置上限
        string mNP0 = "NP0";//设置下限

        public PumpControl()
        {
            mCanId=Can.Pump_ID;
            mSCmd = new Dictionary<int, string>();

            mSCmd.Add(1, mOP);
            mSCmd.Add(2, mCl);
            mSCmd.Add(3, mNP1);
            mSCmd.Add(4, mNP0);
        }
        /// <summary>
        /// 开泵
        /// </summary>
        /// <returns>1</returns>
        public int Open()
        {
            SendCmd(1, mOP);
            mStatus = -1;
            return 1;
        }
        /// <summary>
        /// 关泵
        /// </summary>
        /// <returns>2</returns>
        public int Close()
        {
            SendCmd(2, mCl);
            mStatus = -2;
            return 2;
        }
        /// <summary>
        /// 设置气压上限
        /// </summary>
        /// <param name="pumpNumber">1号负压，2号正压，3号洗板负压</param>
        /// <param name="pressureNumber">气压值</param>
        /// <returns>3</returns>
        public int UpAirPressure(int pumpNumber,int pressureNumber)
        {
            SendCmd(3, mNP1);
            mStatus = -3;
            return 3;
        }
        /// <summary>
        /// 设置气压下限
        /// </summary>
        /// <param name="pumpNumber">1号负压，2号正压，3号洗板负压</param>
        /// <param name="pressureNumber">气压值</param>
        /// <returns>3</returns>
        public int LowAirPressure(int i,int j)
        {
            SendCmd(4, mNP0);
            mStatus = -4;
            return 4;
        }

    }
}
